package com.wk.cart.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * SpringSecurity配置 放行所有请求 否则需要登录后才能访问
 */
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        //允许所有请求通过
        http.authorizeRequests().antMatchers("/**").permitAll();

        //禁用csrf
        http.csrf().disable();
    }
}
